<include file="Public:header" />
<div id="zoneHeader">
    <h2>查看广告位信息</h2>
    <ul>
        <li><a href="?m={$Think.const.MODULE_NAME}" class="btn">返回</a></li>
    </ul>
</div><!--/#zoneHeader-->
<div id="zoneBody" class="noFooter">
    <div id="zoneBodyContent">
        <form id="formEdit">
            <input type="hidden" name="zone_id" />
            <table class="table3" style="width:780px;margin:auto;">
                <tr>
                    <td width="150" align="right">广告位名称：</td>
                    <td colspan="3"><input type="text" name="zone_name" /></td>
                    <td width="130" align="right">创建时间：</td>
                    <td><span name="zone_create_time"></span></td>
                </tr>
                <tr>
                    <td align="right">广告位尺寸：</td>
                    <td><span name="zone_width"></span>X<span name="zone_height"></span></td>
                    <td width="150" align="right">广告位类型：</td>
                    <td width="100"><span name="zone_type"></span></td>
                    <td align="right">计费模式：</td>
                    <td><span name="plan_type"></span></td>
                </tr>
                <tr id="cpmOptList">
                    <td align="right">弹窗选项：</td>
                    <td colspan="5">
                        <label><input name="cpm_opt" type="radio" value="0" /><span>刷新弹出</span></label>
                        <label><input name="cpm_opt" type="radio" value="1" /><span>指定时间</span></label>
                        <span id="cpmOptInterval"><input type="text" name="zone_cpm_interval" class="fW50p" /> 分钟弹出一次</span>
                    </td>
                </tr>
                <tr>
                    <td align="right">广告显示方式：</td>
                    <td colspan="5">
                        <label><input name="zone_auto_view" type="radio" value="1" /><span>智能显示广告</span></label>
                        <label><input name="zone_auto_view" type="radio" value="0" /><span>选择广告</span></label>
                        <div id="zoneAdList">
                        <empty name="ad">
                        <p>没有找到合适的广告！</p>
                        <else />
                        <volist name="ad" id="vo">
                        <dl>
                            <dt>{$vo.plan_name}</dt>
                            <dd>
                                <ul>
                                <volist name="vo.ads" id="vo2">
                                <li>
                                    <label><input type="checkbox" name="zone_view_ad_id[]" value="{$vo2.ad_id}" /><span>广告编号：{$vo2.ad_id}</span></label>
                                    <iframe src="?m=Ad&a=show&id={$vo2.ad_id}" frameborder="0" scrolling="auto"></iframe>
                                </li>
                                </volist>
                                </ul>
                            </dd>
                        </dl>
                        </volist>
                        </empty>
                        </div><!--/#zoneAdList-->
                    </td>
                </tr>
            </table>
        </form>
    </div><!--/#zoneBodyContent-->
</div><!--/#zoneBody-->
<script>
$(function(){
    <notempty name="record">
    var record = {$record|json_encode};
    record.plan_type = '{$record.plan_type|strtoupper}';
    record.zone_type = '{$record.zone_type|getAdTypeCn}';
    <if condition="$record.type EQ 'tw'">
    record.html_code = record.code;
    <else />
    record.img_url = record.code;
    </if>

    <if condition="$record.plan_type EQ 'cpm'">
        <if condition="$record.width EQ 0 AND $record.height EQ 0">
        record.cpm_size = 0;
        <else />
        record.cpm_size = 1;
        </if>

        <if condition="$record.zone_cpm_interval GT 0">
        record.cpm_opt = 1;
        <else />
        record.cpm_opt = 0;
        </if>
    </if>

    Conf.set('formEditDao', record);
    </notempty>

    Zone.edit.init();

    $('#formEdit').find('input, select').attr('readonly', true);
})
</script>
<script type="text/javascript" src="Tpl/Js/app.js"></script>
<include file="Public:footer" />
